﻿using UnityEngine;
/// <summary>
/// 序列化数据【抽象】
/// </summary>
[System.Serializable]
public abstract class AbsSFSerializdata : ISerializationCallbackReceiver
{
    /// <summary>
    /// OnBeforeSerialize
    /// </summary>
    public void OnBeforeSerialize()
    {
        OnReadyDeserialize(); 
    }

    /// <summary>
    /// OnAfterDeserialize
    /// </summary>
    public void OnAfterDeserialize()
    {
        OnSaveSerialize();
    }

    /// <summary>
    /// 读取序列化数据
    /// </summary>
    protected virtual void OnReadyDeserialize() { }

    /// <summary>
    /// 保存序列化数据
    /// </summary>
    protected virtual void OnSaveSerialize()
    {

    }
}
